uploadedDocument Message Type
The doc covers the format of new message type that is used in file upload feature from chatbot and dashboard.
Format
The format is as:-
"result" : {
"messages" : [
{
"payload" : {
"fileUrl" : "", // url uploaded file
"fileType" : "", // A media type (also known as a Multipurpose Internet Mail Extensions or MIME type)
"fileSize" : "", // filesize in bytes
"fileName" : "", // fileName including the extension
"pages" : undefined // number of pages of the uploaded file, undefined incase of image
},
"type" : "uploadedDocument" // must be 'uploadedDocument'
}
]
}
The changes in this message type will be only in the payload and type keys, rest of the format will be same as text message
Examples
template example incase of customer:-
.
.
.
"sender" : "customer",
"message" : {
"psid" : "16757172_fc4c827bd",
"result" : {
"messages" : [
{
"payload" : { // payload changed
"fileUrl" : "https://oriserve-poc-uploads.s3.ap-south-1.amazonaws.com/16835",
"fileType" : "application/pdf",
"fileSize" : "232422",
"fileName" : "yawar.pdf",
"pages" : "3"
},
"type" : "uploadedDocument" // type changed to uploadedDocument, this would be 'text' incase of text message
}
]
}
}
.
.
.
template example incase of Agent:-
.
.
.
"sender" : "admin",
"message" : {
"result" : {
"bot_messages" : [
{
"readStatus" : "seen",
"senderInfo" : {
"pseudoName" : "",
"imgUrl" : "",
"role" : "Agent",
"psid" : "f4048182bc6958fb",
"lastName" : "Mushtaq_2",
"firstName" : "Yawar_1"
},
"timestamp" : 16829384896.0,
"sender" : "admin",
"containsHTML" : true,
"payload" : { // payload changed
"fileUrl" : "https://oriserve-poc-uploads.s3.ap-south-1.amazonaws.com/1684598",
"fileType" : "image/png",
"fileSize" : "2532363",
"fileName" : "yawar.png",
"pages" : null
},
"delay" : "",
"type" : "uploadedDocument" // type changed
}
]
},
"sentTimestamp" : 1682939582.0,
"psid" : "16826808c3099",
"deliveryTimestamp" : 168296908.0
}
.
.
.